#ifndef __PARSER_UNREF_H__
#define __PARSER_UNREF_H__

#include "parser.h"
#include "redobject.h"

#define ref_any(v)		((v)->node.ref++)

/* language structures */

RED_EXPORT void unref_if(if_t *self);
RED_EXPORT void unref_for(for_t *self);
RED_EXPORT void unref_try(try_t *self);
RED_EXPORT void unref_case(case_t *self);
RED_EXPORT void unref_while(while_t *self);
RED_EXPORT void unref_except(except_t *self);
RED_EXPORT void unref_switch(switch_t *self);
RED_EXPORT void unref_compond(compond_t *self);
RED_EXPORT void unref_function(function_t *self);

/* statements */

RED_EXPORT void unref_assign(assign_t *self);
RED_EXPORT void unref_delete(delete_t *self);
RED_EXPORT void unref_augment(augment_t *self);

/* control flows */

RED_EXPORT void unref_break(break_t *self);
RED_EXPORT void unref_return(return_t *self);
RED_EXPORT void unref_continue(continue_t *self);

/* generic statement */

RED_EXPORT void unref_statement(statement_t *self);

/* assign targets */

RED_EXPORT void unref_name(name_t *self);
RED_EXPORT void unref_attr(attr_t *self);
RED_EXPORT void unref_index(index_t *self);
RED_EXPORT void unref_invoke(invoke_t *self);
RED_EXPORT void unref_rvalue(rvalue_t *self);

/* expressions */

RED_EXPORT void unref_expr(expr_t *self);
RED_EXPORT void unref_unit(unit_t *self);
RED_EXPORT void unref_const(const_t *self);
RED_EXPORT void unref_range(range_t *self);

#endif /* __PARSER_UNREF_H__ */
